xen/gnttab: Fix error path in map_grant_ref()
authorRoss Lagerwall <ross.lagerwall@citrix.com>
Tue, 14 Apr 2020 13:05:01 +0000 (15:05 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 14 Apr 2020 13:05:01 +0000 (15:05 +0200)
commit52da38987adec9c1f2138d6eb4a1f107744936c1
tree13742c56565103108a374abb6de2f0e2ef9dbd9f
parentd430e15e021b81f1f6c3e35d703a6f195a9b2e5c
xen/gnttab: Fix error path in map_grant_ref()

Part of XSA-295 (c/s 863e74eb2cffb) inadvertently re-positioned the brackets,
changing the logic.  If the _set_status() call fails, the grant_map hypercall
would fail with a status of 1 (rc != GNTST_okay) instead of the expected
negative GNTST_* error.

This error path can be taken due to bad guest state, and causes net/blk-back
in Linux to crash.

This is XSA-316.

Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
master commit: da0c66c8f48042a0186799014af69db0303b1da5
master date: 2020-04-14 14:41:02 +0200
xen/common/grant_table.c